#!/bin/sh

set -e

echo "168highLow"
gpiopath="/sys/class/gpio/gpio168"
direction=${gpiopath}"/direction"
value=${gpiopath}"/value"
data=0

if [ -d ${gpiopath} ]; then
    echo 168 > /sys/class/gpio/unexport
fi

echo 168 > /sys/class/gpio/export
echo out > ${direction}

while true; do
    echo 1 > ${value}
    data=$(cat ${value})
    sleep 2s
    echo 0 > ${value}
    data=$(cat ${value})
    sleep 2s
done

#echo 168  > /sys/class/gpio/unexport

